package dao.interest;

import vo.InterestVO;

import com.ibatis.sqlmap.client.SqlMapClient;

public class InterestDAOImpl implements InterestDAO{

	private SqlMapClient sqlMapClient;

	public void setSqlMapClient(SqlMapClient sqlMapClient) {
		this.sqlMapClient = sqlMapClient;
	}

	@Override
	public int isInterested(InterestVO interest) throws Exception {
		return (int) sqlMapClient.queryForObject("interest.isInterested", interest);
	}

	@Override
	public void interestUnit(InterestVO interest) throws Exception {
		sqlMapClient.insert("interest.interestUnit",interest);
	}

	@Override
	public void uninterestUnit(InterestVO interest) throws Exception {
		sqlMapClient.delete("interest.uninterestUnit", interest);
	}

	@Override
	public int countInterestedUnit(int member_no) throws Exception {
		return (int) sqlMapClient.queryForObject("interest.countInterestedUnit", member_no);
	}
	
}
